﻿/**********************************************************************
 * @file   FITKAcousticsFENodeMap.h
 * @brief  FE模型节点与SEA模型的节点映射
 * @author liuzhonghua (liuzhonghuaszch@163.com)
 * @date   2024-11-18
 *********************************************************************/
#ifndef _FITK_ACOUSTICS_FENODE_MAP__H___
#define _FITK_ACOUSTICS_FENODE_MAP__H___
 
#include "FITKAcousticsModelAPI.h"
#include "FITK_Kernel/FITKCore/FITKAbstractDataObject.h"
#include "FITK_Kernel/FITKCore/FITKAbstractDataManager.hpp"

namespace AbaqusData
{
    class FITKAbaqusPart;
}

namespace Acoustics
{
    /**
     * @brief  FE模型节点与SEA模型的节点映射
     * @author liuzhonghua (liuzhonghuaszch@163.com)
     * @date   2024-11-18
     */
    class FITKAcousticsModelAPI FITKAcousticsFENodeMap : public Core::FITKAbstractDataObject
    {
        Q_OBJECT
    public:
        /**
         * @brief Construct a new FITKAcousticsFENodeMap object
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date   2024-11-18
         */
        explicit FITKAcousticsFENodeMap() = default;
        /**
         * @brief Destroy the FITKAcousticsFENodeMap object
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date   2024-11-18
         */
        virtual ~FITKAcousticsFENodeMap() = default;
        /**
         * @brief    设置partID
         * @param[i] partID 
         * @return   void
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2024-11-18
         */
        void setPartID(int partID);
        /**
         * @brief    获取partID
         * @return   int
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2024-11-18
         */
        int getPartID();
        /**
         * @brief    设置节点映射
         * @param[i] nodeFEID 
         * @param[i] nodeDiscID 
         * @return   void
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2024-11-18
         */
        void setNodeMap(int nodeFEID, int nodeDiscID);
        /**
         * @brief    通过FE节点ID获取离散节点id
         * @param[i] nodeFEID 
         * @return   int
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2024-11-18
         */
        int getDiscNodeID(int nodeFEID);

    private:
        /**
         * @brief  part数据对象Id
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date   2024-11-18
         */
        int m_partID{ -1 };
        /**
         * @brief  part数据节点Id与离散数据节点Id的映射表
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date   2024-11-18
         */
        QHash<int, int> m_nodesMap{};
    };

    /**
     * @brief FE模型节点与SEA模型的节点映射
     * @author liuzhonghua (liuzhonghuaszch@163.com)
     * @date   2024-11-18
     */
    class FITKAcousticsModelAPI FITKAcousticsFENodeMapManager : public Core::FITKAbstractDataManager<FITKAcousticsFENodeMap>
    {
    public:
        /**
         * @brief Construct a new FITKAcousticsFENodeMap object
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date   2024-11-18
         */
        explicit FITKAcousticsFENodeMapManager() = default;
        /**
         * @brief Destroy the FITKAcousticsFENodeMap object
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date   2024-11-18
         */
        virtual ~FITKAcousticsFENodeMapManager() = default;
        /**
         * @brief    根据partId获取FE节点映射表
         * @param[i] partID 
         * @return   FITKAcousticsFENodeMap *
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2024-11-18
         */
        FITKAcousticsFENodeMap* getFENodeMapByPartID(int partID);
    };
}


#endif
